﻿using System;
using System.Web.Mvc;
using SlamCms.Common;

namespace SlamCms.Web.Mvc
{
    public class SlamModelBinderProvider : IModelBinderProvider
    {
        public IModelBinder GetBinder(Type modelType)
        {
            if (modelType.IsArray && modelType.In(typeof(int[]), typeof(string[]), typeof(float[]), typeof(double[])))
                return new SeparatedValuesModelBinder();

            // default behavior
            return null;
        }
    }
}